package com.hzncc.flowable_diboot.contract.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindEntity;
import com.diboot.core.binding.annotation.BindEntityList;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.contract.entity.*;
import com.hzncc.flowable_diboot.entity.SapCustomer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Map;

/**
 * @Description :
 * @Date : 2024/7/15
 * @Author : ChenJin
 * @Version : v1.0.0
 **/
@Getter @Setter @Accessors(chain = true)
public class ContractAuditVO extends ContractAuditDetailVO{

    private static final long serialVersionUID = 1815917471705812826L;

    @BindDict(
            type = "auditType",
            field = "auditType"
    )
    private LabelValue auditTypeLabel;

    /**
     * 客户姓名
     */
    //@BindField(
    //        entity = SapCustomer.class,
    //        field = "name",
    //        condition = "this.customer_id = id"
    //)
    //private String customerName;

    @BindField(
            entity = SapCustomer.class,
            field = "sapNo",
            condition = "this.customer_id = id"
    )
    private String sapNo;

    @BindField(
            entity = IamUser.class,
            field = "userNum",
            condition = "this.saler = id"
    )
    private String salesmanNo;

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.signer = id"
    )
    private String signerName;

    /**
     * 合同基础信息
     */
    @BindEntity(
            entity = ContractInfo.class,
            condition = "this.id = contract_audit_id",
            deepBind = true
    )
    private ContractInfoListVO contractInfoVO;

    /**
     * 合同扩展信息
     */
    @BindEntity(
            entity = ContractExt.class,
            condition = "this.id = contract_audit_id",
            deepBind = true
    )
    private ContractExtListVO contractExtVO;

    /**
     * 合同项目信息
     */
    @BindEntityList(
            entity = ContractProduct.class,
            condition = "this.id = contract_audit_id",
            deepBind = true
    )
    private List<ContractProductListVO> contractProductVOList;

    /**
     * 合同变更信息
     */
    @BindEntity(
            entity = ContractAuditUpdate.class,
            condition = "this.id = contract_audit_id",
            deepBind = true
    )
    private ContractAuditUpdateListVO contractAuditUpdateVO;

    /**
     * 合同取消信息
     */
    @BindEntity(
            entity = ContractAuditCancel.class,
            condition = "this.id = contract_audit_id",
            deepBind = true
    )
    private ContractAuditCancelListVO contractAuditCancelVO;

    /**
     * 变更对比信息
     */
    private List<DiffVO> diffVOList;

    /**
     * 产品对比信息
     */
    private Map<String,String> productDiffVO;

    private List<ProductDiffVO> productDiffVOList;

    private Boolean isStar;

    /**
     * 新增物料
     */
    private List<ChangeMrlVO> addMrl;

    /**
     * 删除物料
     */
    private List<ChangeMrlVO> delMrl;

    /**
     * 变更详情
     */
    private List<ProductDiffVO> cncProductDiff;

    /**
     * 折扣 多配置以‘/’分隔
     */
    private String discounts;

    /**
     * 产品型号  多配置以‘/’分隔
     */
    private String productTypes;
}
